package edu.hnu.commonutils;


import io.swagger.annotations.ApiModel;

@ApiModel("返回码")
public enum EnumResultCode {
  /* 成功状态码 */
  SUCCESS(0, "成功"),

  /* 失败状态码 */
  FAIL(200, "失败"),

  /* 系统500错误*/
  SYSTEM_ERROR(10000, "系统异常，请稍后重试"),
  UNAUTHORIZED(10401, "签名验证失败"),
  TEST(500, "测试异常"),

  /* 参数错误：10001-19999 */
  PARAM_IS_INVALID(10001, "参数无效"),


  USER_NOT_FIND(20002, "用户名不存在或密码错误"),


  /* 数据库访问出错 */
  DB_UPDATE_FAILED(35000,"修改数据库错误"),
  DB_INSERT_FAILED(35001,"数据库插入数据出错"),
  DB_SELECT_FAILED(35002,"数据库查找数据出错");



  private final Integer code;

  private final String msg;

  EnumResultCode(Integer code, String msg) {
    this.code = code;
    this.msg = msg;
  }

  public Integer getCode() {
    return this.code;
  }

  public String getMsg() {
    return this.msg;
  }

}
